<?php

namespace app\model;

use think\Model;

class Rooms extends Model
{

    static function createOneRoom($param){
        $time=time();
        $rid = substr($time,2,8);
        $data['id']=$rid;
        $data['title']=$param['title'];
        $data['create_time']=$time;
        $data['creator']=$param['uid'];
        $data['avatar']='https://avatar.tobi.sh/'.$rid.'?size=64';
        return self::create($data);
    }
    
}
